package com.beiding.workordersystem.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.util.Set;

@Setter
@Getter
@TableName("account")
public class AccountEntity {
    @TableId
    private String id;
    private String username;
    private String password;

    @TableField(exist = false)
    private Set<RoleEntity> roleEntities;

    @Override
    public int hashCode() {
        return id.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof AuthorityEntity) {
            return this.id.equals(((AuthorityEntity) obj).getId());
        }
        return false;
    }
}
